import IndexApi from '@/api/index.js'
export default {
    state: {
       config:{}
    },
    getters: {
       
    },
    mutations: {
		setConfig(state,config){
			state.config=config
		}
    },
    actions: {
		getConfig(context){
			return new Promise((resolve,reject) => {
				IndexApi.getConfig().then(res=>{
					if(res.code==200){
						context.commit('setConfig',res.data)
						resolve(res.data)
					}else{
						reject(res)
					}
				}).catch(e=>{
					reject(e)
				})
			})
		}
    }
}